<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="/resource/css/admin/main.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/right.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.js"></script>
<script type="text/javascript" src="/resource/js/base.js"></script>
<script type="text/javascript" src="/resource/js/admin/columns.js"></script>
</head>
<body>
	<div class="position"><span>您的当前位置：</span>网站维护 > 网站栏目管理</div>
    <div class="rightbody f">
    	<div class="rightbodycontent">
		    <table class="tools">
		        <tr>
		            <td align="right">
	            		<a href="edit" class="linkbtn insert">新建一级栏目</a>
		            </td>
		        </tr>
		    </table>
		    <table cellspacing="1" cellpadding="4" class="tablelist">
		        <tr>
		            <th width="3%">ID</th>
		            <th width="30%">栏目名称</th>
		            <th width="30%">URL地址</th>
		            <th>跳转方式</th>
		            <th>显示</th>
		            <th>排序</th>
		            <th>操作</th>
		        </tr>
				<#list columns1es as columns1>
					<tr class="splittr">
						<td align="center">${columns1.id}</td>
						<td style="padding-left:11%;">
							<#if columns2Maps?keys?seq_contains(columns1.id?c)><span class="opensecond close" onclick="swtichsecond(this,${columns1.id})"></span>
							<#else>&nbsp;&nbsp;&nbsp;
						</#if>
						${columns1.name}
						<#if columns2Maps?keys?seq_contains(columns1.id?c)>
						[${columns2Maps[columns1.id?c]?size}]
					</#if>
					</td>
					<td align="center">
						<#assign columns1urldirectory = "">
						<#if columns1.columnsType.id == 1 || columns1.columnsType.id == 3>
						<#assign columns1urldirectory = "/" + columns1.urldirectory + "/">
						<#elseif columns1.columnsType.id == 2>
						<#assign columns1urldirectory = "/" + columns1.zhuanti.urldirectory + "/">
						<#elseif columns1.columnsType.id == 5>
						<#assign columns1urldirectory = "/" + columns1.urldirectory + "/">
						<#else>
						<#assign columns1urldirectory = "--无链接--">
					</#if>
					${columns1urldirectory}
					</td>
					<td align="center">${columns1.target!}</td>
					<td align="center"><img src="/resource/image/admin/main/right/ico/${columns1.display?string("ok","delete")}.png" /></td>
					<td align="center">${columns1.sort}</td>
					<td align="center">
						<a href="edit?parentid=${columns1.id}" class="linkbtn insert noborder">新建二级栏目</a>
						<a href="edit?columnsid=${columns1.id}" class="linkbtn update noborder">修改</a>
						<a href="delete?columnsid=${columns1.id}" class="linkbtn delete noborder" onclick="return confirm('<#if columns2Maps?keys?seq_contains(columns1.id?c)>操作会连同该栏目的子栏目一起删除，</#if>确定删除吗？')">删除</a>
					</td>
					</tr>
					<#if columns2Maps?keys?seq_contains(columns1.id?c)>
						<#list columns2Maps[columns1.id?c] as columns2>
							<tr class="second${columns1.id}">
								<td align="center">${columns2.id}</td>
								<td style="padding-left:12%;">┝ ${columns2.name}</td>
								<td align="center">
									<#assign columns2urldirectory = "">
									<#if columns2.columnsType.id == 1 || columns2.columnsType.id == 3>
									<#assign columns2urldirectory = "/" + columns2.urldirectory + "/">
									<#if columns1.columnsType.id == 1 || columns1.columnsType.id == 2 || columns1.columnsType.id == 3>
									<#assign columns2urldirectory = "/" + columns1.urldirectory + columns2urldirectory>
								</#if>
								<#elseif columns2.columnsType.id == 2>
								<#assign columns2urldirectory = "/" + columns2.zhuanti.urldirectory + "/">
								<#elseif columns2.columnsType.id == 5>
								<#assign columns2urldirectory = columns2.urldirectory>
							</#if>
							${columns2urldirectory}
							</td>
							<td align="center">${columns2.target}</td>
							<td align="center"><img src="/resource/image/admin/main/right/ico/${columns2.display?string("ok","delete")}.png" /></td>
							<td align="center">${columns2.sort}</td>
							<td align="center">
								<a href="edit?columnsid=${columns2.id}&parentid=${columns1.id}" class="linkbtn update noborder">修改</a>
								<a href="delete?columnsid=${columns2.id}" class="linkbtn delete noborder" onclick="return confirm('确定删除吗？')">删除</a>
							</td>
							</tr>
						</#list>
					</#if>
				</#list>
		    </table>
	    </div>
    </div>
</body>
</html>